#ifndef __NURBS_NODE__
#define __NURBS_NODE__

#include "attribute.h"
#include "simplex.h"

class Node : public Simplex {
public:
	Node(Attribute& attribute, size_t id) : Simplex(attribute, id) {}

	Node* Neighbor(size_t i) {return neighbor[i];}
	Node* Neighbor(size_t i) const {return neighbor[i];}
	size_t NumNeighbors() const {return neighbor.size();}
	void SetNeighbor(Node* v, size_t i) {neighbor[i] = v;}
	void AddNeighbor(Node* v) {
		if(std::find(neighbor.begin(), neighbor.end(), v) == neighbor.end())
			neighbor.push_back(v);
	}
	void ResizeNeighbors(size_t n) {
		neighbor.clear();
		neighbor.resize(n);
	}
private:
	std::vector<Node*> neighbor;
};

bool IsAdjacent(Node* v1, Node* v2);

#endif //__NURBS_NODE__
